using System.Data;
using System.Data.SqlClient;
using NUnit.Framework;
using PhillyCodeCamp.Infrastructure;
using PhillyCodeCampSpecs.Helpers;

namespace PhillyCodeCampSpecs
{
    [TestFixture]
    public class When_Asked_To_Resolve_A_Registered_Implementation_Of_An_Interface
    {
        [Test]
        public void Should_Return_A_Concrete_Object ()
        {
            var connection = new SqlConnection();
            var resolver = new StubResolver(connection);
            DependencyResolver.InitializeWith(resolver);

            Assert.AreEqual(connection, DependencyResolver.Resolve<IDbConnection>());
        }
    }
}